package role

const (
	ordinary = iota + 1 // 村民
	god                 // 神职
	wolf                // 狼人
)

const (
	GoodMan = iota + 1
	BadMan
)

type Base struct {
	alive          bool
	speakable      bool // 可发言
	votable        bool // 可投票
	identity       int
	voteValue      float64
	IsComForPolice bool
}

func (b *Base) IsAlive() bool {
	return b.alive
}

func NewBase(identity int) *Base {
	return &Base{
		alive:     true,
		speakable: true,
		votable:   true,
		identity:  identity,
		voteValue: 1,
	}
}

func (b *Base) VoteOut() {
	b.alive = false
}

func (b *Base) ChangeVoteVaule() {
	b.voteValue = 1.5
}

func (b *Base) GetVoteVaule() float64 {
	return b.voteValue
}

func (b *Base) Speakable() bool {
	return b.alive && b.speakable
}

func (b *Base) Votable() bool {
	return b.alive && b.votable
}

func (b *Base) EnableSpeak() {
	b.speakable = true
}

func (b *Base) EnableVote() {
	b.votable = true
}

func (b *Base) EnableAlive() {
	b.alive = true
}

func (b *Base) DisableSpeak() {
	b.speakable = false
}

func (b *Base) DisableVote() {
	b.votable = false
}

func (b *Base) DisableAlive() {
	b.alive = false
}

func (b *Base) GetBase() *Base {
	return b
}

//func (b *Base) ComForPolice() {
//	b.IsComForPolice = true
//}
//
//func (b *Base) GiveupForPolice() {
//	b.IsComForPolice = false
//}
//func (b *Base) GetComForPolice() bool {
//	return b.IsComForPolice
//}
